<?php


namespace app\admin\validates;


use think\Validate;

class SubjectValidate extends Validate
{
    /**
     * 验证规则
     * @var array
     */
    protected $rule = [
        'id' => 'require|number',
        'title' => 'require',
        'degree' => 'require|number',
        'type' => 'require|number',
        'question_id' => 'require|number',
        'sort' => 'number',
        'analysis' => 'require',
        'analysis_desc' => 'require',
        'status' => 'require',
        'content' => 'require',
    ];

    /**
     * 验证字段描述
     * @var string[]
     */
    protected $field = [
        'id' => 'ID',
        'title' => '题干',
        'degree' => '难度',
        'type' => '类型',
        'question_id' => '题库',
        'sort' => '排序',
        'status' => '状态',
        'content' => '题目选项',
    ];

    /**
     * 验证场景
     * @var array
     */
    protected $scene = [
        'add' => ['title', 'degree','type','question_id','sort','analysis_desc','content'],
        'edit' => ['id', 'title', 'degree','type','question_id','sort','analysis_desc','content'],
        'del' => ['id'],
        'details' => ['id'],
        'do_status' => ['id','status']
    ];
}